#ifndef BOOK_H
#define BOOK_H

#include <string>
#include <iostream>

class Book {
private:
    std::string name;
    std::string author;
    int publish_year;
public:
    // Constructors & destructor
    Book();
    Book(const char *name, const char *author, int publish_year);
    Book(std::string name, std::string author, int publish_year);
    Book(const Book &other);
    ~Book();

    // Setters & getters
    void setName(const char *name);
    void setName(std::string name);
    void setAuthor(const char *author);
    void setAuthor(std::string author);
    void setPublishYear(int publish_year);
    void setBook(const char *name, const char *author, int publish_year);
    void setBook(std::string name, std::string author, int publish_year);

    char * getName();
    char * getAuthor();
    int getPublishYear();

    // Overloads
    Book & operator=(const Book &other);
    Book & operator=(Book &&other) noexcept;

    // Friend functions
    friend std::ostream & operator<<(std::ostream &os, const Book &book);
    friend std::istream & operator>>(std::istream &is, Book &book);
};

std::ostream & operator<<(std::ostream &os, const Book &book);
std::istream & operator>>(std::istream &is, Book &book);

#endif // BOOK_H
